<script setup>
import {ref} from "vue";

const f = ()=>{
  alert('click')
}

const search = ref('')
const ent = ()=>{
  alert('你搜索的是'+search.value+'吗？')
}
</script>

<template>
<h1>事件绑定指令</h1>
  <button @click="f">按钮1</button>
  <button v-on:click="f">按钮1</button>
  <h3>敲回车事件</h3>
  <input type="text" placeholder="请输入你搜索的关键词" v-model="search" @keydown.enter="ent">
</template>

<style scoped>

</style>